import { request } from "../request";

export interface DeleteQuestionByIdRes {
    code: number;
    message: string;
    data: string;
    timestamp: Record<string, unknown>;
}

const deleteQuestionByIdAPI = async (questionId: number): Promise<DeleteQuestionByIdRes> => {
    const token = localStorage.getItem("token");
    return request(`/api/questions/delete/${questionId}`, {
        method: "delete",
        headers: {
            "Content-Type": "application/json",
            "Authorization": `Bearer ${token}`,
        },
    });
};

export default deleteQuestionByIdAPI;
